VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsEmailExtract"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
Public Function EmailExtract(ByVal FormAD As Variant, ByVal FormB As Variant, ByVal FormC As Variant, ByVal IRP3a As Variant, ByVal IRP3b As Variant, ByVal IRP3c As Variant) As String


'Send Mail
Dim cJMail As clsJMail
Set cJMail = New clsJMail
cJMail.EMailServer = "trend1.liberty.co.za"
cJMail.MsgFrom = "info@keytax.co.za"
cJMail.MSGFromName = "KeyTax: Tax Directives"
cJMail.MSGSubject = "Extracted Directive Request Files for " & Date
cJMail.MSGBody = "Extracted Directive Request Files for " & Date
cJMail.AddRecipient "shane.smith@liberty.co.za", "Shane Smith"
If FormAD <> "" Then
  cJMail.AddAttachment FormAD
End If
If FormB <> "" Then
  cJMail.AddAttachment FormB
End If
If FormC <> "" Then
  cJMail.AddAttachment FormC
End If
If IRP3a <> "" Then
  cJMail.AddAttachment IRP3a
End If
If IRP3b <> "" Then
  cJMail.AddAttachment IRP3b
End If
If IsObject(IRP3c) = False Then
  cJMail.AddAttachment IRP3c
End If


If Not cJMail.SendMSG Then
  EmailExtract = "Error sending email"
  Exit Function
End If

Set cJMail = Nothing

End Function


